<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* class的继承 */
        /* 人是动物中的一类  anim(父类)  person（子类） */
        class Anim{
            constructor(name,age){
                this.nama = name;
                this.age =age;
            }
        }

       /*  class Person{
            constructor(name,age){
                this.name = name;
                this.age =age;
            }
        } */

        class Person extends Anim{
            constructor(name,age){
                super(name,age);
            }
        }
        let hw = new Person('hanweichen',18);
        console.log(hw);
    </script>
</body>
</html>